<template>
    <div class="w-full h-full flex flex-col">
        <div class="w-full  flex flex-col">
            <el-page-header @back="$router.back()" :content="s_inves.m_inv.id ? '编辑调查问卷' : '添加调查问卷'">
            </el-page-header>
            <el-divider class=" mb-w10"></el-divider>
        </div>
        <div class="w-full h-w800 flex flex-col overflow-y-auto ">
            <div class="flex flex-row items-center w-w1/2 h-w50 leading-w50 text-c3 text-f16  mt-w30">
                <div class=" w-w1/4 text-right pr-w20">问卷名称</div>
                <el-input class="w-w2/4" placeholder="请输入内容" v-model="s_inves.m_inv.name" clearable autofocus>
                </el-input>
            </div>
            <div class="flex flex-row items-start  w-w1/2   text-c3 text-f16  mt-w30">
                <div class=" w-w1/4 text-right pr-w20 ">列表封面</div>
                <div class="flex flex-col">
                    <el-upload action="" :show-file-list="false" :on-change="action_select_list_cover"
                        :auto-upload="false" accept="image/png, image/jpeg">
                        <img v-if="s_inves.m_inv.listCoverUrl" :src="s_inves.m_inv.listCoverUrl"
                            style="width: 100px;height: 100px;  display: block;">
                        <i v-else class="el-icon-plus avatar-uploader-icon"
                            style="width:100px;height:100px;line-height:100px;"></i>
                    </el-upload>
                    <div class=" mt-w5 text-f15 text-c6">图片尺寸：360px*284px</div>
                </div>
            </div>
            <div class="flex flex-row items-start  w-w1/2   text-c3 text-f16  mt-w30">
                <div class=" w-w1/4 text-right pr-w20 ">内容封面</div>
                <div class="flex flex-col">
                    <el-upload action="" :show-file-list="false" :on-change="action_select_info_cover"
                        :auto-upload="false" accept="image/png, image/jpeg">
                        <img v-if="s_inves.m_inv.infoCoverUrl" :src="s_inves.m_inv.infoCoverUrl"
                            style="width: 244px;height: 100px;  display: block;">
                        <i v-else class="el-icon-plus avatar-uploader-icon"
                            style="width:244px;height:100px;line-height:100px;"></i>
                    </el-upload>
                    <div class=" mt-w5 text-f15 text-c6">图片尺寸：828px*362px</div>
                </div>
            </div>
            <div class="flex flex-row items-center w-w1/2   text-c3 text-f16  mt-w30">
                <div class=" w-w1/4 text-right pr-w20">问卷类型</div>
                <el-radio-group class="w-w3/4" v-model="s_inves.m_inv.type">
                    <el-radio :label="0">普通问卷</el-radio>
                    <el-radio :label="1">综合问卷（带量表）</el-radio>
                </el-radio-group>
            </div>

            <div class="flex flex-row items-top w-w1/2  text-c3 text-f16  mt-w30" v-if="s_inves.m_inv.type == 1">
                <div class=" w-w1/4 text-right pr-w20">问卷介绍</div>
                <el-input type="textarea" :rows="5" class="w-w3/4" placeholder="请输入内容" v-model="s_inves.m_inv.info">
                </el-input>
            </div>

            <div class="flex flex-row items-top w-w1/2  text-c3 text-f16  mt-w30" v-if="s_inves.m_inv.type == 1">
                <div class=" w-w1/4 text-right pr-w20">问卷描述</div>
                <el-input type="textarea" :rows="5" class="w-w3/4" placeholder="请输入内容" v-model="s_inves.m_inv.desc">
                </el-input>
            </div>


            <div class="flex flex-row items-center w-w1/2   text-c3 text-f16  mt-w30" v-if="s_inves.m_inv.type == 1">
                <div class=" w-w1/4 text-right pr-w20">基本信息模板</div>
                <el-select class="w-w3/4" v-model="s_inves.m_inv.baseTemplate" placeholder="请选择">
                    <el-option v-for="item in s_inves.list_template_base" :key="item.id" :label="item.name"
                        :value="item.id">
                    </el-option>
                </el-select>
            </div>
            <div class="flex flex-row items-center w-w1/2   text-c3 text-f16  mt-w30">
                <div class=" w-w1/4 text-right pr-w20">问卷问题模板</div>
                <el-select class="w-w3/4" v-model="s_inves.m_inv.questionTemplate" placeholder="请选择">
                    <el-option v-for="item in s_inves.list_template_question" :key="item.id" :label="item.name"
                        :value="item.id">
                    </el-option>
                </el-select>
            </div>
            <div class="flex flex-row items-center w-w1/2   text-c3 text-f16  mt-w30" v-if="s_inves.m_inv.type == 1">
                <div class=" w-w1/4 text-right pr-w20">关联量表</div>
                <el-select class="w-w3/4" v-model="s_inves.m_inv.assessId" placeholder="请选择">
                    <el-option v-for="item in s_assess.list_assess" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
                </el-select>
            </div>
            <div class="flex flex-row items-start w-w1/2   text-c3 text-f16  mt-w30">
                <div class=" w-w1/4 text-right pr-w20"></div>
                <el-button class="w-w2/4 bg-cmain" type="primary" @click="action_add_inv">确定</el-button>
            </div>
        </div>
    </div>
</template>

<script src="./Index.ts"></script>
<style src="./Index.less" lang="less" scoped>

</style>
